/**
 * 
 */
package com.flyco.modules.stm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.flyco.modules.stm.entity.DistrictEntity;
import com.flyco.modules.stm.vo.DistrictDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface DistrictDao extends BaseMapper<DistrictEntity> {

	List<DistrictEntity> selectOneLevelDistrict();

	DistrictEntity selectOneLevelById(Long id);

	DistrictEntity selectByIdAndParentId(@Param("parentId") Long parentId, @Param("id") Long id);

	DistrictEntity selectOneByCode(String code);

	List<DistrictEntity> selectAllDistrict();

	List<DistrictDto> selectChildDistrict(Long parentDistrictId);


	Integer deleteDistrictById(Long id);

	List<DistrictEntity> selectDistricts(@Param(value = "districtIds") List<Long> districtIds);

}